extends CharacterBody3D

@export var speed = 4.0
@export var turn_speed = 0.8
@export var gravity = 0.5
func _physics_process(delta):
	velocity.y -= gravity * delta
	get_input(delta)
	move_and_slide()
func get_input(delta):
	var vy = velocity.y
	velocity = Vector3.ZERO
	var move = Input.get_axis("back", "forward")
	var turn = Input.get_axis("right", "left")
	velocity += -transform.basis.z * move * speed
	rotate_y(turn_speed * turn * delta)
	velocity.y = vy
